<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic"%>
<%@ taglib uri="/WEB-INF/tld/jstl/c" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/tld/jstl/fn" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="ebb365,ebb365,ebb365">
		<meta http-equiv="description" content="ebb365">
		<title>【广告描述----列表】</title>
		<link rel="stylesheet" type="text/css" href="/admin/css/css.css">
		<style type="text/css">
			.vb_wid {width:100%; margin: 0 auto; border-top:1px #FDB18D solid; background:#F5F5F5; color:#FE6500; text-indent:20px; line-height:25px; font-size:12px;}
			.fb_search {width:100%; margin:0 auto; margin-top:20px; border:1px #FFCD7F solid;}
			.fb_search h1 {background:#FFEFBB; margin:0px; padding:0px; line-height:28px; text-indent:10px; font-size:14px;}
			.fb_s_a1 {margin:5px; font-size:14px;}
			.fb_s_a2 {font-size:12px; line-height:22px; color:#999; margin-left:5px;}
			.fb_ddd {width:100%; margin:0 auto; margin-top:10px; border-top:3px #FFCC00 solid; background:url(/zst/manage/images/pen.gif) no-repeat 5px 3px; height:40px; text-indent:50px; line-height:40px; color:#464646; font-size:12px;}
			.fb_nr {width:100%; margin:0 auto; margin-top:10px; line-height:22px; font-size:12px; color:#464646}
			.fb_nr span {color:#FF0000;}
			.fb_nr select {color:464646; font-size:12px;}
			.fb_nr Div {margin-top:10px; height:30px;}
			.fb_nr Div input {font-size:12px; line-height:18px;}
			.inputtttt {border:1px #DEA303 solid; height:20px; color:#464646; font-size:12px; background:url(/zst/manage/images/bottom_bg.jpg) repeat-x left top;}
			.lb {background:#FFCD7F; color:#464646; font-weight:bold; text-align:center; height:30px; line-height:30px;}
			.lb1 {border-bottom:1px #000000 dashed; height:28px;}
			.lb1 td {border-bottom:1px #ccc dashed; background:#eefefe}
			.fy1 {width:100%; margin:0 auto; margin-top:8px; background:#F8F8F8; font-size:12px; height:30px; line-height:28px; text-indent:10px;}
			.fy1 span {color:#FF0000; font-weight:bold;}
			.fy1 a {color:#464646; text-decoration:none;}
			.fy1 a:hover {color:#FF0000; text-decoration:underline;}
		</style>
		<link rel="stylesheet" type="text/css" href="/zst/manage/style/public.css">
		<link rel="stylesheet" type="text/css" href="/zst/manage/style/manage.css">
		<script type='text/javascript' src='/dwr/interface/homeSiteDWRServ.js'></script>
		<script type='text/javascript' src='/dwr/engine.js'></script>
		<script type='text/javascript' src='/dwr/util.js'></script> 
		<script language="JavaScript">
<!--//	
		function topage(){
			var id = document.getElementById('toPage').value;
			var linkStr = document.getElementById('linkStr').value;
			if(isNaN(id)){
				alert('请输入数字');
				return false;
			}
			if(id!=''){
				window.location.href = "/admin/banner/homeSiteAdBannerDesprite.do?action=list&bk_page="+id+linkStr;
				return true;
			}
				return false;
		}

		
		function selectAll(choice) {
			var chk = document.getElementsByName("checkboxparam");
			for (var i=0;i<chk.length;i++) {
				var e=chk[i];
				if(choice==1){
					e.checked=true;
				}
				if(choice==2){
					e.checked=(e.checked?false:true);
				}
				if(choice==3){
					e.checked=false;
				}
			}
		}

		function checkboxIsSelected(){
		var chk = document.getElementsByName("checkboxparam");
		   for (var i=0;i<chk.length;i++) {
		        var e=chk[i];
		        if(e.checked){
			        return true;  
			    }
		   }
		   window.alert('至少选择一项!');
		   return false;
		}
		
//-->
</script>
<script type="text/javascript" language="javascript">
		  //通过一级分类id,获取二级分类的列表
		  function loadSecondHomeSiteClassList()
		  {
		      var newsClassId = document.getElementById('firstNewsClassId').value;
		     if(newsClassId!=null  && newsClassId!='-1')
		     {
		       //alert('广告栏目id:'+newsClassId);
		        //获取二级列表
		        homeSiteDWRServ.loadSecondHomeSiteNewsClassByAdType(newsClassId,fillSecondList);
		        
		     }
		  }
		  
		  
		  //通过二级分类id,获取三级分类的列表
		   function loadThirdHomeSiteClassList()
		  {
		      var newsClassId = document.getElementById('secondNewsClassId').value;
		     if(newsClassId!=null  && newsClassId!='-1')
		     {
		       //alert('广告栏目id:'+newsClassId);
		        //获取二级列表
		        homeSiteDWRServ.loadSecondHomeSiteNewsClassByAdType(newsClassId,fillThirdList);
		     }
		  }
		     
		  
		  //二级分类列表
		  var data2;
		  function fillSecondList(data2)
		  {
		    DWRUtil.removeAllOptions("secondNewsClassId");
            //DWRUtil.addOptions("secondNewsClassId", data2.id,data2.picName);
            DWRUtil.addOptions("secondNewsClassId", {'-1':'请选择'});
            DWRUtil.addOptions("secondNewsClassId", data2);
		  }
		  
		  
		  //填充三级分类列表
		  var data3;
		  function fillThirdList(data3)
		  {
		    DWRUtil.removeAllOptions("thirdNewsClassId");
            //DWRUtil.addOptions("thirdNewsClassId", data3.id,data3.picName);
            DWRUtil.addOptions("thirdNewsClassId", {'-1':'请选择'});
            DWRUtil.addOptions("thirdNewsClassId", data3);
		  }
		  
		</script>
	</head>

<body>
	
		<div class="vb_wid">
			【广告描述----列表】
			<div class="fb_s_a1">
			<c:set var="linkStr" value="&bk_description=${bk_description}&bk_newsClassId=${bk_newsClassId}
			&bk_firstNewsClassId=${bk_firstNewsClassId}&bk_secondNewsClassId=${bk_secondNewsClassId}&bk_thirdNewsClassId=${bk_thirdNewsClassId}"></c:set>
			
				<html:form action="/admin/banner/homeSiteAdBannerDesprite.do?action=search" method="post">
    	           图片描述：<html:text property="picInfo" value="${bk_description}" size="10"></html:text>　
					分 类： 
							<html:select property="firstNewsClassId" onchange="loadSecondHomeSiteClassList();">
							   <html:option value="-1">---请选择---</html:option>
							   <logic:present name="firstHomeSiteNewsClassList">
							   		<logic:iterate id="list" name="firstHomeSiteNewsClassList">
									    <option value="${list.id}" <c:if test="${list.id==bk_firstNewsClassId}">selected</c:if>>${list.names}</option>
								    </logic:iterate>
							   </logic:present>							   
							</html:select>
													
							<html:select property="secondNewsClassId" onchange="loadThirdHomeSiteClassList();">
							   <html:option value="-1">---请选择---</html:option>
							   <logic:present name="secondNewsClassList">
							   		<logic:iterate id="list" name="secondNewsClassList">
									    <option value="${list.key}" <c:if test="${list.key==bk_secondNewsClassId}">selected</c:if>>${list.value}</option>
								    </logic:iterate>
							   </logic:present>
							</html:select>
						
							<html:select property="thirdNewsClassId">
							   <html:option value="-1">---请选择---</html:option>
							   <logic:present name="thirdNewsClassList">
							   		<logic:iterate id="list" name="thirdNewsClassList">
									    <option value="${list.key}" <c:if test="${list.key==bk_thirdNewsClassId}">selected</c:if>>${list.value}</option>
								    </logic:iterate>
							   </logic:present>
							</html:select>
					　<html:submit value="给我搜" />　　					
					<a href="/admin/banner/homeSiteAdBannerDesprite.do?action=toAdd">添 加</a>			
    			</html:form>
			</div>
	


		<div class="fb_nr">
			<c:set var="linkStr" value="&bk_description=${bk_description}&bk_newsClassId=${bk_newsClassId}
			&bk_firstNewsClassId=${bk_firstNewsClassId}&bk_secondNewsClassId=${bk_secondNewsClassId}&bk_thirdNewsClassId=${bk_thirdNewsClassId}"></c:set>
			<html:form action="/admin/banner/homeSiteAdBannerDesprite.do?action=delete${linkStr}&bk_page=${curPage}" method="post">		
			
			<table width="100%" border="0" cellspacing="1">
				<tr class="lb">
					<td width="5%">
						选择
					</td>
					<td width="5%">
						ID
					</td>
					<td width="20%">
						图片描述
					</td>
					<td width="15%">
						栏目分类
					</td>
					<td width="20%">
						图片名称
					</td>
					<td width="10%">
						删除与否
					</td>
					<td width="8%">
						编　辑
					</td>
				</tr>

				<logic:notEmpty name="descriptList">
					<logic:iterate id="list" name="descriptList">
						<input type="hidden" name="id" value="${list.id}"/>
							<tr align="center" class="lb1">
								<td>
									<input type="checkbox" name="checkboxparam"
										value="${list.id}">
								</td>
								<td>${list.id}</td>
								<td>${list.picInfo}</td>
								<td>${list.newsClassName}</td>
								<td>${list.picName}</td>
								<td>${list.del!=0?'★':'☆'}</td>								
								<td>
									<a href="/admin/banner/homeSiteAdBannerDesprite.do?action=toUpdate&id=${list.id}${linkStr}&bk_page=${curPage}">
										<img src="/admin/images/edititem.gif"/>
									</a>
								</td>
							</tr>
						</logic:iterate>
				</logic:notEmpty>

				<tr>
					<td colspan="13">
						<div>
							<label>
								<html:button onclick="selectAll(1);" property="button"
									value="全选" />
								&nbsp;
								<html:button onclick="selectAll(2);" property="button"
									value="反选" />
								&nbsp;
								<html:button onclick="selectAll(3);" property="button"
									value="不选" />
								&nbsp;
								<input type="submit" value="设置/取消删除" name="submit"
									onclick="return checkboxIsSelected();">
								<font color="red">注：&nbsp;★ 为是， ☆ 为否</font>
							</label>
						</div>
					</td>
				</tr>
			</table>
		</html:form>
	</div>
		
			</div>
		<div class="fy1">
			<form id="pageForm" action="">
				
				<input id="linkStr" value="${linkStr}" type="hidden"/>
				<table>
					<tr>
						<td align="rigth">
							总共&nbsp;<b>${recordNum}</b>&nbsp;条记录，&nbsp;&nbsp;
							当前第&nbsp;<font color="red"><b>${curPage}</b></font>&nbsp;/ ${allPage}&nbsp;页　
							<c:if test="${curPage<2}"> 上一页</c:if>
							<c:if test="${curPage>1}">
								<html:link action="/admin/banner/homeSiteAdBannerDesprite.do?action=list&bk_page=${backPage}${linkStr}">上一页</html:link>
							</c:if>
							　/　
							<c:if test="${curPage==allPage}"> 下一页 </c:if>
							<c:if test="${curPage<allPage}">
								<html:link action="/admin/banner/homeSiteAdBannerDesprite.do?action=list&bk_page=${nextPage}${linkStr}">下一页</html:link>
							</c:if>

							<input id="toPage" name="toPage" type="text" class="input100"
								size="5" />
							页&nbsp;
							<input type="button" value="查 看" title="查 看" onclick="return topage();" />
						</td>
					</tr>
				</table>
			</form>
		</div>
		

		<logic:present name="msg">
			<bean:write name="msg" filter="false" />
		</logic:present>

	</body>
</html>
